﻿<Helpers:LayoutAwarePage
    x:Name="pageRoot"
    xmlns:Models="using:JumpstartApp.Models" 
    xmlns:Controls="using:JumpstartApp.Controls"
    xmlns:ViewModels="using:JumpstartApp.ViewModels"
    xmlns:JumpstartApp="using:JumpstartApp"
    x:Class="JumpstartApp.Views.Camera"
    xmlns:Helpers="using:JumpstartApp.Helpers"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:JumpstartApp.Views"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">
    <Helpers:LayoutAwarePage.DataContext>
        <ViewModels:CameraViewModel/>
    </Helpers:LayoutAwarePage.DataContext>

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">

        <Grid x:Name="FillView">
            <Controls:Silhouette Title="Profile Picture" SubTitle=" " x:Name="MySilhouette" ShowGuide="False" />
            <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Border Grid.RowSpan="2" Grid.Column="0">
                    <CaptureElement x:Name="MyCaptureElement" Height="200" Width="300" />
                </Border>
                <Button Grid.Column="1" Grid.Row="0" Content="Capture" FontSize="30" Width="200" VerticalAlignment="Stretch" Command="{Binding TakeCommand, Mode=OneWay}" />
                <Button Grid.Column="1" Grid.Row="1" Content="Accept" FontSize="30" Width="200" VerticalAlignment="Stretch" Command="{Binding AcceptCommand, Mode=OneWay}" />
                <Border Grid.RowSpan="2" Grid.Column="2">
                    <Image x:Name="MyImage" Height="200" Width="300" Source="{Binding Image}" />
                </Border>
            </Grid>
            <Controls:BackButton />
        </Grid>

        <Grid x:Name="PortraitView" Visibility="Collapsed">
            <Controls:Silhouette Title=" " SubTitle=" " />
            <Controls:BackButton />
        </Grid>

        <Grid x:Name="SnapView" Visibility="Collapsed">
            <Controls:Silhouette Title=" " SubTitle=" " />
            <TextBlock Style="{StaticResource PageHeaderTextStyle}" VerticalAlignment="Top" Margin="40">
            	<Run Text="Profile"/>
            </TextBlock>
        </Grid>


        <Canvas x:Name="PrintContainer" Opacity="0"/>

        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="ApplicationViewStates">
                <VisualState x:Name="FullScreenLandscape">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FillView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SnapView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PortraitView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Filled">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FillView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SnapView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PortraitView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="FullScreenPortrait">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FillView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SnapView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PortraitView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Snapped">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FillView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="SnapView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PortraitView" Storyboard.TargetProperty="Visibility">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>
</Helpers:LayoutAwarePage>